package com.edu.test2;

public class PrimeNumber {
	public static void printPrimeNumber(int range) {
		int i, num, num2, sum = 0;
		for (num = 2; num <= range; num++) {
			num2 = (int) Math.sqrt(num);
			for (i = 2; i <= num2; i++) {
				if (num % i == 0)
					break;
			}
			if (i == num2 + 1) {
				sum++;
				System.out.print(num + "\t");
				if (sum % 5 == 0)
					System.out.println();
			}
		}
	}

	public static void main(String[] args) {
		printPrimeNumber(20000);
	}


}
